package com.example.communitypro.controller;


import com.example.communitypro.pojo.UserResource;
import com.example.communitypro.pojo.UserSearchHistory;
import com.example.communitypro.service.UserResourceService;
import com.example.communitypro.service.UserSearchHistoryService;
import com.example.communitypro.util.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/userResource")
public class UserResourceController {

    @Autowired
    private UserResourceService userResourceService;

    @ResponseBody
    @RequestMapping(value = "/addUserResource")
    @CrossOrigin
    public Result addUserResource(UserResource record){
        return userResourceService.addUserResource(record);
    }

    @ResponseBody
    @RequestMapping(value = "/dropUserResource")
    @CrossOrigin
    public Result dropUserResource(Integer userResourceNo){
        return userResourceService.dropUserResource(userResourceNo);
    }

    @ResponseBody
    @RequestMapping(value = "/modifyUserResource")
    @CrossOrigin
    public Result modifyUserResource(UserResource record){
        return userResourceService.modifyUserResource(record);
    }

    @ResponseBody
    @RequestMapping(value = "/queryUserResource")
    @CrossOrigin
    public Result queryUserResource(Integer userResourceNo){
        return userResourceService.queryUserResource(userResourceNo);
    }

    @ResponseBody
    @RequestMapping(value = "/queryAllUserResource")
    @CrossOrigin
    public Result queryAllUserResource(){
        return userResourceService.queryAllUserResource();
    }

    @ResponseBody
    @RequestMapping(value = "/quertUserResourceByUserResourceNo")
    @CrossOrigin
    public Result quertUserResourceByUserResourceNo(Integer user_resource_no){
        return userResourceService.quertUserResourceByUserResourceNo(user_resource_no);
    }
}
